import React, { useRef } from 'react'
function Child () {
  return (
    <div>child</div>
  )
}
function App() {
  const oDivRef = useRef()
  // const childRef = useRef()
  const getData = () => {
    console.log(oDivRef)
    // console.log(childRef)
  }
  return (
    <div>
      <button onClick = { getData }>获取数据</button>
      <div ref= { oDivRef }>你好</div>
      {/* <Child ref = { childRef }/> */}
    </div>
  )
}

export default App
